#include <iostream>
#include <cstring>
using namespace std;

char a[510];
char b[510];

int main()
{
	float n = 0;
	cin >> n;
	cin >> a;
	cin >> b;
	int len = strlen(a);
	int i = 0;
	int res = 0;
	while(a[i++] != '\0')
	{
		if(a[i] == b[i])
			res++;
	}
	if(res * 1.0 / len >= n)
		cout << "yes" << endl;
	else
		cout << "no" << endl;
	return 0;
}
